<template>
  <RouterView></RouterView>
</template>

<script lang="ts" setup>
import { onMounted } from 'vue'
import { useConfigStore } from '@/stores/useConfigStore'
import { EditorTheme } from '@/types/enum/configEnum'
import { useChangeEditorConfig } from '@/hooks/useChangeEditorConfig'
import { debounce } from '@/utils/common'
const { setDarkTheme, setLightTheme } = useChangeEditorConfig()

onMounted(() => {
  if (useConfigStore().getEditorConfig().theme === EditorTheme.dark) {
    setDarkTheme()
  } else {
    setLightTheme()
  }
})

const _ResizeObserver = window.ResizeObserver;
window.ResizeObserver = class ResizeObserver extends _ResizeObserver{
   constructor(callback: any) {
     callback = debounce(callback, 200);
     super(callback);
   }
}

</script>

<style lang="scss"></style>